package cn.iocoder.yudao.module.book.convert;

import cn.iocoder.yudao.module.book.controller.app.records.vo.AppRecordsRespVO;
import cn.iocoder.yudao.module.book.dal.dataobject.records.RecordsDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface AppRecordsConvert {

    AppRecordsConvert INSTANCE = Mappers.getMapper(AppRecordsConvert.class);

    // 单个 DO 转 VO
    @Mapping(source = "recordId", target = "recordId")
    @Mapping(source = "bookId", target = "bookId")
    @Mapping(source = "userId", target = "userId")
    @Mapping(source = "readingCount", target = "readingCount")
    AppRecordsRespVO convert(RecordsDO recordsDO);

    // 列表 DO 转 VO
    List<AppRecordsRespVO> convertList(List<RecordsDO> recordsDOS);
}
